home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 273_01.zip / CHGTO.CC < prev    next >
Text File  |  1993-04-04  |  910b  |  27 lines

  1. #include <dir.h>
  2.  
  3. change_to(char *dir)
  4. /*
  5. ┌────────────────────────────────────────────────────────────────────┐
  6. │Purpose: To change the current disk drive and directory with        │
  7. │         one call.                                                  │
  8. │ Inputs: Char *dir points to directory to change to. This may       │
  9. │         contain a drive letter if required.                        │
  10. │Outputs: None.                                                      │
  11. │                                                                    │
  12. │ Return:  0 = successful.                                           │
  13. │         -1 = directory not found.                                  │
  14. └────────────────────────────────────────────────────────────────────┘
  15. */
  16. {
  17. char disk;
  18.  
  19.     if(*(dir + 1) == ':') {
  20.         disk = *dir;
  21.         disk = toupper(disk);
  22.         setdisk(disk - 'A');
  23.     }
  24.  
  25.     return(chdir(dir));
  26. }
  27.